<?php
require_once("../inc/conn.php");
require_once("../inc/session.php");
//读取记录
$sql="select * from department order by id desc";
$rs=$conn->query($sql);
?>
<!doctype html>
<html>
<meta charset="utf-8" />
<title>显示数据记录</title>
</head>

<body>

<form><table width="98%" border="1" align="center" cellpadding="5">
  <tbody>
    <tr>
      <td colspan="3" align="center">部门列表&nbsp; 【<a href="adddepart.php"> 写入信息</a> 】</td>
    </tr>
    <tr>
      <td width="6%" align="center">序号</td>
      <td width="17%" align="center">部门名称</td>
      <td width="11%" align="center">操作</td>
    </tr>
	  
	<?php
	  $i=0;
       while($row = $rs->fetch_assoc()) {
	$i++;
?> 
    <tr>
      <td align="center"><?php echo $i;?></td>
      <td align="center"><?php echo $row[ "name" ];?>
      </td>
      <td align="center">&nbsp;
		 
		  <a href="deldepart.php?id=<?php echo $row[ "id" ];?>">删除</a>
		  &nbsp;</td>
    </tr>
	  
<?php
	}
?> 
    </tbody>
</table></form>
</body>
</html>
